bitkeeper revision 1.1684 (42a468f4PvUu-iWAyhHxfE-JnhHVYw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 6 Jun 2005 15:17:08 +0000 (15:17 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Mon, 6 Jun 2005 15:17:08 +0000 (15:17 +0000)
Remove strrchr/strnlen/memscan from x86-specific string.h. They are not
used so not worth optimising (strnlen is used only in vsprintf which is
not performance critical).
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/include/asm-x86/string.h

index 6ab83cf53d13c502ba89a0376d285a37de3182d1..83d1fbb58357b7a1fc0b31835332c402d6474800 100644 (file)
@@ -136,23 +136,6 @@ static inline char *strchr(const char *s, int c)
     return __res;
 }
 
-#define __HAVE_ARCH_STRRCHR
-static inline char *strrchr(const char *s, int c)
-{
-    long d0, d1;
-    register char *__res;
-    __asm__ __volatile__ (
-        "   mov  %%al,%%ah  \n"
-        "1: lodsb           \n"
-        "   cmp  %%ah,%%al  \n"
-        "   jne  2f         \n"
-        "   lea  -1(%1),%0  \n"
-        "2: test %%al,%%al  \n"
-        "   jne  1b         \n"
-        : "=g" (__res), "=&S" (d0), "=&a" (d1) : "0" (0), "1" (s), "2" (c) );
-    return __res;
-}
-
 #define __HAVE_ARCH_STRLEN
 static inline size_t strlen(const char *s)
 {
@@ -321,24 +304,6 @@ static inline void *__constant_c_memset(void *s, unsigned long c, size_t count)
     return s; 
 }
 
-#define __HAVE_ARCH_STRNLEN
-static inline size_t strnlen(const char *s, size_t count)
-{
-    long d0;
-    register int __res;
-    __asm__ __volatile__ (
-        "   jmp  2f       \n"
-        "1: cmpb $0,(%3)  \n"
-        "   je   3f       \n"
-        "   inc  %3       \n"
-        "2: dec  %1       \n"
-        "   jns  1b       \n"
-        "3: subl %2,%0    \n"
-        : "=a" (__res), "=&d" (d0)
-        : "c" ((int)(long)s), "0" (s), "1" (count) );
-    return __res;
-}
-
 /*
  * This looks horribly ugly, but the compiler can optimize it totally,
  * as we by now know that both pattern and count is constant..
@@ -427,19 +392,4 @@ static always_inline void *__constant_c_and_count_memset(
  __constant_c_x_memset((s),(MEMSET_PATTERN_MUL*(unsigned char)(c)),(count)) : \
  __var_x_memset((s),(c),(count)))
 
-#define __HAVE_ARCH_MEMSCAN
-static inline void *memscan(void *addr, int c, size_t size)
-{
-    if ( size == 0 )
-        return addr;
-    __asm__ (
-        "   repnz; scasb \n"
-        "   jnz  1f      \n"
-        "   dec  %0      \n"
-        "1:              \n"
-        : "=D" (addr), "=c" (size)
-        : "0" (addr), "1" (size), "a" (c) );
-    return addr;
-}
-
 #endif /* __X86_STRING_H__ */